package com.itheima.sh.feign;

import com.itheima.sh.feign.fallback.UserFeignFallbackApi;
import com.itheima.sh.pojos.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author balisong_fcs
 * @date 2020/12/20 18:57
 */
//@FeignClient("user-server")
@FeignClient(value = "user-server", fallback = UserFeignFallbackApi.class)
public interface FeignApi {

    //服务提供方,提供的接口方法
    //Feign 对Springsmc注解增强
    @GetMapping("/user/{id}")
    public User queryById(@PathVariable("id") String username);
}
